package gui;

import antGraph.AntVertex;

import java.awt.Color;
import java.awt.Graphics;

public class GUINode {

	private int positionX;
	private int positionY;
	private int XIndex;
	private int YIndex;
	public static final int WIDTH = 30;
	public static final int HEIGHT = 30;
	private static final int FACTOR = 40;
	private Color myColor;
	
	private AntVertex antVertex;

	public GUINode(AntVertex antVertex) {
		this.antVertex = antVertex;
		this.XIndex = antVertex.getCoordinates().getX();
		this.YIndex = antVertex.getCoordinates().getY();
		this.positionX = FACTOR*XIndex + FACTOR;
		this.positionY = FACTOR*YIndex + FACTOR;
		this.myColor = Color.WHITE;
	}

	public void draw(Graphics graphics, GraphScreen graphScreen) {
		graphics.setColor(myColor);
		graphics.fillOval(positionX, positionY, WIDTH, HEIGHT);
		graphics.setColor(Color.BLACK);
		graphics.drawOval(positionX, positionY, WIDTH, HEIGHT);
		graphics.drawString(XIndex+","+YIndex, positionX+2, positionY+HEIGHT/2+2);
	}

	public void setPositionX() {
		this.positionX = positionX;
	}

	public int getPositionX() {
		return positionX;
	}

	public void setPositionY() {
		this.positionY = positionY;
	}

	public int getPositionY() {
		return positionY;
	}
	
	public void setColor(Color myColor){
		this.myColor = myColor;
	}
	
	public AntVertex getAntVertex(){
		return antVertex;
	}
}
